from django.db import models


class ProductionDeployRecord(models.Model):
    '''线上环境部署历史记录'''

    name = models.CharField(max_length=100, verbose_name="项目名称", help_text="项目名称")
    tag = models.CharField(max_length=20, verbose_name="镜像标签", help_text="镜像标签")
    env = models.CharField(max_length=20, verbose_name="部署环境", help_text="部署环境")
    create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建日期", help_text="更新日期")
    update_time = models.DateTimeField(auto_now=True, verbose_name="更新日期", help_text="更新日期")

    class Meta:
        verbose_name = "云环境部署历史记录"
        verbose_name_plural = verbose_name
        db_table = "product_deploy_record"

    def __str__(self):
        return self.name
